﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;


/// <summary>
/// Summary description for Chat
/// </summary>
public class Chaaaaaaat
{
    public static bool chatting(string username, string message)
    {

        using (SWE2Entities db = new SWE2Entities())
        {
            Chatting_Table ch = new Chatting_Table();
            if (string.IsNullOrEmpty(message) || string.IsNullOrEmpty(username))
            {
                return false;
            }
            else
                ch.Chat = message;
            ch.Username = username;
            db.Chatting_Table.Add(ch);
            db.SaveChanges();
            return true;

        }
    }

}